home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / prog / mspell.zip / MGSPELL.H < prev    next >
C/C++ Source or Header  |  1991-04-13  |  3KB  |  126 lines

  1. /*  ┌──────────────────────────────────────────────────────────────────┐
  2.     │                        MicroGenesis Spell V1.2                   │
  3.     │                                                                  │
  4.     │                     Copyright 1991 by Jeff Heaton                │
  5.     │                                                                  │
  6.     │            Source code may not be distributed in any form.       │
  7.     │                                                                  │
  8.     └──────────────────────────────────────────────────────────────────┘ */
  9.  
  10.  
  11. /*    mgspell.h
  12.  
  13.     Defines structs, unions, macros, and functions for dealing
  14.     with the MicroGenesis Spelling Checker.
  15.  
  16.     Copyright (c) Jeff Heaton 1990,1991
  17.     All Rights Reserved.
  18. */
  19. /* Include following line to produce shareware version */
  20. /* Shareware version is no longer supported, NEVER include the
  21.    following line: */
  22.  
  23. /* #define SHAREWARE */
  24.  
  25.  
  26. #include <stdio.h>
  27.  
  28. #ifndef __MGSPELL_H
  29. #define __MGSPELL_H
  30.  
  31.  
  32. #if defined(__TURBOC__)
  33.     #if __STDC__
  34.         #define _Cdecl
  35.     #else
  36.         #define _Cdecl  cdecl
  37.     #endif
  38.  
  39.     #ifndef __PAS__
  40.         #define _CType _Cdecl
  41.     #else
  42.         #define _CType pascal
  43.     #endif
  44. #elif defined(__ZTC__)
  45.     #define _Cdecl
  46.     #define _NEAR
  47. #elif defined(M_I86) && !defined(__ZTC__)
  48.     #if!defined(NO_EXT_KEYS)
  49.         #define _Cdecl cdecl
  50.         #define _Near  near
  51.     #else
  52.         #define _Cdecl
  53.         #define _Near
  54.     #endif
  55. #endif
  56.  
  57. typedef struct {
  58.     long    index[26][26];
  59.     long    words[26][26];
  60. }     INDEX;
  61.  
  62.  
  63. typedef struct {
  64.     FILE *fp;
  65.     unsigned char bitpos;
  66.     unsigned char curbyte;
  67. }    DICT;
  68.  
  69.  
  70. /* Variables */
  71. extern  char           *_Cdecl  path_main;
  72. extern  char           *_Cdecl  path_user;
  73. extern    char         _Cdecl    suggest[10][30];
  74. extern    char        _Cdecl    lastword0[80];
  75. extern    char        _Cdecl    lastword1[80];
  76. extern    INDEX        _Cdecl    index;
  77.  
  78.  
  79.  
  80. #ifdef __cplusplus
  81. extern "C" {
  82. #endif
  83. /* IO.C */
  84.  
  85. void         _Cdecl next_word    (DICT *fp,char *word);
  86. void         _Cdecl write_word    (DICT *fp,char *word);
  87. void         _Cdecl write_index    (FILE *fp);
  88. void         _Cdecl read_index    (FILE *fp);
  89. void     _Cdecl    open_spell    (DICT *fp);
  90. void     _Cdecl    s_seek    (DICT *fp, long position);
  91. void     _Cdecl    s_putc    (DICT *fp, char chr);
  92. char     _Cdecl s_getc    (DICT *fp);
  93.  
  94. /* LOOKUP.C */
  95. char         _Cdecl spell_check    (char *word);
  96. char     _Cdecl    add_word(char *word);
  97. char     _Cdecl fast_check(DICT *fp,char *word);
  98.  
  99.  
  100. /* SUGGEST.C */
  101. void         _Cdecl suggest_word(char *word);
  102. int     _Cdecl    comp    (char *word1, char *word2);
  103.  
  104. /* MISC.C */
  105. void     _Cdecl    inc    (int *dm1, int *dm2);
  106. void     _Cdecl    dec    (int *dm1, int *dm2);
  107. void         _Cdecl scan_word(char *word);
  108. long     _Cdecl    words    (int dm1, int dm2);
  109. void     _Cdecl    encode    (char *word);
  110. void     _Cdecl    decode    (char *word);
  111. void     _Cdecl    reset    (void);
  112. void     _Cdecl    fgetstr    (FILE *fp,char *word);
  113.  
  114. /* WORD.C */
  115. long     _Cdecl word_count(void);
  116.  
  117. char     _Cdecl    dump    (char *name);
  118. void     _Cdecl    import    (void);
  119.  
  120.  
  121. #endif
  122. #ifdef __cplusplus
  123. }
  124. #endif
  125.  
  126.